//
//  GKHomeInfo.swift
//  MySwiftObject
//
//  Created by wangws1990 on 2019/9/9.
//  Copyright © 2019 wangws1990. All rights reserved.
//

import UIKit
enum GKHomeInfoState {
    case DataNet
    case Database
}
class GKHomeInfo: BaseModel {
    var books :[GKBookModel]!;
    var total :Int!;
    var title :String!;
    var shortTitle :String!;
    var _id :String!;
    
    var _moreData :Bool!
    var _listData :[GKBookModel]!;
    var state :GKHomeInfoState!
    var listData : [GKBookModel]{
        set{
            _listData = newValue;
        }get{
            if self.books != nil {
                let count : Int = self.books.count > 6 ? 6 : self.books.count;
                return []+self.books.prefix(count)
            }
            return [];
        }
    }
    var moreData:Bool{
        set{
            _moreData = newValue;
        }get{
            let more : Bool = self.books.count > 6 ? true : false;
            return more;
        }
    }
    
}
